package com.saclub.app.fragment;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.widget.BaseAdapter;
import android.widget.ListView;
import butterknife.Bind;

import com.loopj.android.http.RequestParams;
import com.saclub.app.R;
import com.saclub.app.activity.MyToolBarActivity;
import com.saclub.app.bean.part.News;
import com.saclub.app.common.AccessTokenKeeper;
import com.saclub.app.common.MyPageHelper;
import com.saclub.app.http.ApiRequest;

public class AccountMyFavFragment extends BaseProgressFragment<MyToolBarActivity>{
	
	@Bind(R.id.id_listview)
	protected ListView listview;

	private BaseAdapter adapter;

	private List<News> list = new ArrayList<News>();

	@Override
	protected int obtainContentRes() {
		return R.layout.account_my_fav;
	}

	@Override
	protected void initParams() {
		
	}

	@Override
	protected void initView() {
		
	}
	
	@Override
	protected void initData() {
		
		AccessTokenKeeper tokenKeeper = AccessTokenKeeper.readAccessToken(getActivity());

		if (tokenKeeper.isLogin()) {
			
			RequestParams params = new RequestParams();
			params.put("webuser_id", tokenKeeper.getOpenId());
			ApiRequest.userLikeList.request(this, params);
			
		}
		
	}
	
	
	public ListView getListview() {
		return listview;
	}

	public List<News> getList() {
		return list;
	}

	public void setAdapter(BaseAdapter adapter) {
		this.adapter = adapter;
	}

	public static void go(Activity act) {
		MyPageHelper.accountMyFavorite.showMyPage(act);
	}



}